﻿#region 文档操作记录
// DeviceStatus.cs
// 说明：
// 
// 创建日期：10:43
// 文档作者：饶杰
//  
// 更新日志：
#endregion

using System;
using System.Collections.Generic;

namespace PullSdkHelper.Tables
{
    /// <summary>
    /// 设备状态
    /// </summary>
    public class DeviceStatus
    {
        /// <summary>
        /// init
        /// </summary>
        public DeviceStatus()
        {
            this.NewRecords = new List<TblTransaction>();
            this.Status = 0;
            this.AlarmStatus = 0;
            this.Time = DateTime.Now;
        }

        /// <summary>
        /// 时间
        /// </summary>
        public DateTime Time { get; set; }

        /// <summary>
        /// 门磁状态
        /// </summary>
        public short Status { get; set; }

        public string StatusText
        {
            get
            {
                switch (Status)
                {
                    case 1:
                        return "门关";
                    case 2:
                        return "门开";
                    case 0:
                        return "无门磁";
                    default:
                        return "离线";
                }
            }
        }

        /// <summary>
        /// 报警状态
        /// </summary>
        public short AlarmStatus { get; set; }

        public string AlarmStatusText
        {
            get
            {
                switch (AlarmStatus)
                {
                    case 1:
                        return "报警";
                    case 2:
                        return "门开超时";
                    case 3:
                        return "报警/门开超时";
                    default:
                        return "";
                }
            }
        }

        public List<TblTransaction> NewRecords { get; set; }


    }

}